<%--
  Created by IntelliJ IDEA.
  User: KK
  Date: 2022/11/22
  Time: 20:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1>${msg}</h1>
<h1>当前在线人数：${userList.size()}</h1>
<table border="1px">
    <tr>
        <td>username</td>
        <td>age</td>
        <td>operator</td>
    </tr>
    <c:forEach items="${users}" var="user">
        <tr>
            <td>${user.name}</td>
            <td>${user.age}</td>
            <td>
                <input type="button" value="删除" onclick="del(${user.name})">
                <button onclick="">修改</button>&nbsp;
            </td>
        </tr>
    </c:forEach>
</table>
<script type="text/javascript">
    function del(username) {
        if (confirm("是否确认删除")) {
            location.assign("DelServlet?name=" + username);
        }
    }
</script>
</body>
</html>
